// GameServer.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "GameServer.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// The one and only application object
#include "WeiQiServer.H"
CWinApp theApp;
void AppMain();
using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
	int nRetCode = 0;

	// initialize MFC and print and error on failure
	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
	{
		// TODO: change error code to suit your needs
		_tprintf(_T("Fatal Error: MFC initialization failed\n"));
		nRetCode = 1;
	}
	else
	{
		AppMain();
		// TODO: code your application's behavior here.
	}

	return nRetCode;
}


void AppMain()
{
	CWeiQiServer server;
	server.init();
	server.StartServer(9999);
/*
	queue<CMsg*> que;
	CMsg msg1;
	CMsg msg2;
	CMsg msg3;
	que.push(&msg1);
	printf("%d\n",que.size());
	que.push(&msg2);
	printf("%d\n",que.size());
	que.push(&msg3);
	printf("%d\n",que.size());
	que.pop();
	printf("%d\n",que.size());
	que.pop();
	printf("%d\n",que.size());
	que.pop();
	printf("%d\n",que.size());
*/
	
	while(1)
	{
		char cmd[128];
		gets(cmd);
	}
}